<div class="col-md-12">
    <form action="" method="post">
        <div class="card">
            <div class="card-header">
                <h3 class="card-title">添加用户</h3>
            </div>
            <div class="card-body">
                <div class="form-group">
                    <label>用户名</label>
                    <input type="text" name="username" class="form-control my-colorpicker1">
                </div>
                <div class="form-group">
                    <label>昵称</label>
                    <input type="text" name="nickname" class="form-control my-colorpicker1">
                </div>
                <div class="form-group">
                    <label>密码</label>
                    <input type="password" name="password" class="form-control my-colorpicker1">
                </div>
                <div class="form-group">
                    <label>后台属组</label>
                    <div class="col-lg-12">
                        <div class="input-group">
                            <div class="input-group-prepend">
                                <span class="input-group-text">
                                    <input type="checkbox" name="admin_group_leader" value="1">&nbsp;&nbsp;&nbsp;&nbsp;<span id='admin_group_leader'>自己</span>
                                </span>
                            </div>
                            <select name='admin_group' class="form-control my-colorpicker1">
                                <option value="0" <?php if (0 == $u_info['admin_group']) {
                                        echo 'selected="selected"';
                                    } ?>>无权限</option>
                                <?php foreach ($group_list[2] as $v) { ?>
                                    <option value="{$v.id}" <?php if ($v['id'] == $u_info['admin_group']) {
                                    echo 'selected="selected"';
                                } ?>>{$v.name}</option>
                                <?php } ?>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label>邮箱</label>
                    <input type="text" name="email" class="form-control my-colorpicker1">
                </div>
                <div class="form-group">
                    <label>手机</label>
                    <input type="text" name="phone" class="form-control my-colorpicker1">
                </div>
            </div>
            <div class="card-footer">
                <button type="submit" class="btn btn-primary">提交</button>
            </div>
        </div>
    </form>
</div>
<script>
$(function(){
    $('input[name=admin_group_leader]').click(function(){
        if($(this).is(':checked')){
            $('#admin_group_leader').html('全部');
        } else {
            $('#admin_group_leader').html('自己');
        }
    });
});
</script>